
class DataBase(object):

    def Find(self, databaseName, tableName, filter={}, sort={}, projection=[]):
        pass

    def Insert(self, databaseName, tableName, document):
        pass

    def Insert_Many(self, databaseName, tableName, documents):
        pass

    def InsertIfNotExisted(self, databaseName, tableName, target, dataObject):
        pass

    def Upsert(self, databaseName, tableName, target, document):
        pass

    def Upsert_Many(self, databaseName, tableName, targets, documents):
        pass

    def Update(self, databaseName, tableName, target, document):
        pass

    def GetDataSeries(self, symbol, dataType=None, instrumentType=None, datetime1=None, datetime2=None):
        pass

    def SaveDataSeries(self, dataSeries, dataType=None, instrumentType=None, isUpSert=True):
        pass

    def Count(self, databaseName, tableName):
        pass

    def GetDataFrame2(self, symbol, dataType=None, instrumentType=None, datetime1=None, datetime2=None):
        pass

    def GetDataFrame(self, databaseName, tableName, filter=[], projection=[], datetime1=None, datetime2=None, sort=None):
        pass

    # 构建Key2 的时间转换请参考
    # df["key2"] = "000001.OF" + "_" + df["date"].apply(lambda x : x.strftime('%Y-%m-%d'))
    def SaveDataFrame(self, databaseName, tableName, df, save_fields=[]):
        pass

    def Get_Instruments(self, instrument_type, filter=[], projection=[], listed=True):
        pass

    def Get_Instruments_DataFrame(self, instrument_type, filter=[], projection=[], listed=True):
        pass

    def Get_Daily_Bar_DataFrame(self, symbol, instrument_type, projection=[], datetime1=None, datetime2=None):
        pass

    def Get_Stock_Daily_Bar_DataFrame(self, symbol, projection=[], datetime1=None, datetime2=None):
        pass

    def Get_Mutual_Fund_Daily_Bar(self, symbol, projection=[], datetime1=None, datetime2=None):
        pass

    def Get_Index_Daily_Bar(self, symbol, projection=[], datetime1=None, datetime2=None):
        pass